package webserver

import "github.com/gin-gonic/gin"

type webServer interface {
	Run(method func(), addr ...string) error // 运行web服务
}

type WebController interface {
	Run() // 运行web控制器服务
}

type webServerImpl struct {
}

var WebServer webServer = (*webServerImpl)(nil)

var Engine *gin.Engine

// Run 运行web服务
func (*webServerImpl) Run(method func(), addr ...string) error {
	Engine = gin.Default()
	method()
	return Engine.Run(addr...)
}
